
package com.carsite.service.impl;

import java.util.List;

import com.carsite.dao.BranchDao;
import com.carsite.model.Branch;
import com.carsite.service.BranchManager;

public class BranchManagerImpl extends BaseManager implements BranchManager {
    private BranchDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setBranchDao(BranchDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.carsite.service.BranchManager#getBranchs(com.carsite.model.Branch)
     */
    public List getBranchs(final Branch branch) {
        return dao.getBranchs(branch);
    }

    /**
     * @see com.carsite.service.BranchManager#getBranch(String branchId)
     */
    public Branch getBranch(final String branchId) {
        return dao.getBranch(new Long(branchId));
    }

    /**
     * @see com.carsite.service.BranchManager#saveBranch(Branch branch)
     */
    public void saveBranch(Branch branch) {
        dao.saveBranch(branch);
    }

    /**
     * @see com.carsite.service.BranchManager#removeBranch(String branchId)
     */
    public void removeBranch(final String branchId) {
        dao.removeBranch(new Long(branchId));
    }

	public List getTopBranchs() {
		return dao.getTopBranchs();
	}
}
